﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PMS.Data.DbUtils.DataMapping;
using PMS.Data.Entities.NaviMenus;

namespace PMS.Data.EntityMap.NaviMenus
{
    /// <summary>
    /// Represents a NaviMenuLayoutTemplate mapping configuration
    /// </summary>
    public partial class NaviMenuLayoutTemplateMappingMap : PMSEntityTypeConfiguration<NaviMenuNaviMenuTemplateMapping>
    {
        #region Methods

        /// <summary>
        /// Configures the entity
        /// </summary>
        /// <param name="builder">The builder to be used to configure the entity</param>
        public override void Configure(EntityTypeBuilder<NaviMenuNaviMenuTemplateMapping> builder)
        {
            builder.ToTable("navimenu_navimenutemplate_mapping");
            builder.HasKey(mapping => new { mapping.NaviMenuId, mapping.NaviMenuTemplateId });
            builder.Property(mapping => mapping.NaviMenuId).HasColumnName("NaviMenuId");
            builder.Property(mapping => mapping.NaviMenuTemplateId).HasColumnName("NaviMenuTemplateId");
            builder.Ignore(mapping => mapping.Id);
            builder.Ignore(mapping => mapping.IsActive);
            builder.Ignore(mapping => mapping.CreatedOnTimeUtc);
            builder.Ignore(mapping => mapping.UpdatedOnTimeUtc);

            base.Configure(builder);
        }

        #endregion
    }
}
